package com.esri.core.map;

import com.esri.core.internal.util.d;
import com.esri.core.map.LayerSource;
import java.io.StringWriter;
import org.codehaus.jackson.JsonGenerator;

/* loaded from: classes.dex */
public class LayerDataSource extends LayerSource {
    DataSource a;

    public LayerDataSource() {
        a(LayerSource.LayerType.DATALAYER);
    }

    public DataSource getDataSource() {
        return this.a;
    }

    public void setDataSource(DataSource dataSource) {
        this.a = dataSource;
    }

    @Override // com.esri.core.map.LayerSource
    public String toJson() throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator a = d.a(stringWriter);
        a.writeStartObject();
        a.writeFieldName("type");
        a.writeString(getType().toString());
        a.writeFieldName("dataSource");
        a.writeRawValue(getDataSource().toJson());
        a.writeEndObject();
        a.close();
        return stringWriter.toString();
    }

    public String toString() {
        return "dataSource=" + this.a;
    }
}
